<script setup>
import { ref, onMounted } from 'vue'
import { patientClassifyAllListAPI } from '@/api/patientClassify'

// 医生分类列表
const patientClassifyList = ref([])
/**
 * 获取医生分类列表
 */
onMounted(async () => {
  const patientClassifyResult =
    await patientClassifyAllListAPI()
  patientClassifyList.value =
    patientClassifyResult.data.data
})

// 父组件传过来的医生分类id, 双向绑定
const classifyId = defineModel()
</script>

<template>
  <el-select
    v-model="classifyId"
    size="large"
    style="width: 220px"
  >
    <el-option
      v-for="item in patientClassifyList"
      :key="item.id"
      :label="item.classifyName"
      :value="item.id"
    />
  </el-select>
</template>

<style lang="scss" scoped></style>
